<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="<?php echo (CSS_URL); ?>bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo (CSS_URL); ?>bootstrap-theme.min.css" />
    <script type="text/javascript" src="<?php echo (JS_URL); ?>jquery-3.1.0.min.js"></script>
    <script type="text/javascript" src="<?php echo (JS_URL); ?>bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo (CSS_URL); ?>jquery-confirm.css" />
        <script type="text/javascript" src="<?php echo (JS_URL); ?>jquery-confirm.min.js"></script>
    </head>
    <script>
        $(function(){
          $(".delete").click(function(){
              var ss=$(this);
              $.confirm({
                title: 'Logout?'+ss.index(".btn"),
                content: 'Your time is out, you will be automatically logged out in 10 seconds.',
                autoClose: 'confirm|10000',
                confirm: function(){
                        $.ajax({
                           type:"GET",
                           url:'<?php echo (ADMIN_URL); ?>article/del/id/'+ss.attr("value"),
                           success:function(msg){
                             window.location.reload()
                           }
                       });
    
                },
                cancel:function(){
                    return;
                }
            });
            
            
       });
      }) 
        </script>
    <body>
    <div class="container-fluid">
         <div class="page-header text-center">
            <h1>文章列表</h1>
          </div>
        <div>
            <a  class="btn btn-default btn-danger" href="<?php echo (ADMIN_URL); ?>article/del/clear/1" >删除所有</a>
             <table class="table table-bordered table-striped">
            <tr>
                <th>文章编号</th>
                <th>标题</th>
                <th>作者</th>
                <th>录入时间</th>
                <th>操作</th>
            </tr>
            <tbody>
                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                <td><?php echo ($vo["id"]); ?></td>
                <td><?php echo ($vo["provider"]); ?></td>
                <td><?php echo ($vo["title"]); ?></td>
                <td><?php echo ($vo["datetime"]); ?></td>
                <td><button  class="btn btn-default btn-danger delete" value="<?php echo ($vo['id']); ?>">删除</button></td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
        </table>
            <div class="h4 text-center"><?php echo ($page); ?></div>
        </div>
       
    </div>
    </body>
</html>